home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 23 / AMIGAplus Sonderheft 23 (2000)(Falke)(DE)[!].iso / PublicDomain / Goldies / PolyEd2 / Macros / newline_indent.ped < prev    next >
Text File  |  1999-11-08  |  2KB  |  49 lines

  1. /*
  2. ** $VER: newline_indent.ped 1.0 (7.5.95) written by Robert Brandner
  3. **
  4. ** Inserts a new, empty line after the current one, and indents the
  5. ** cursor to the beginning of that line.
  6. **
  7. */
  8.  
  9. OPTIONS RESULTS
  10.  
  11. OPTIONS FAILAT 11                           /* ignore warnings          */
  12. SIGNAL ON SYNTAX                            /* ensure clean exit        */
  13. SIGNAL ON FAILURE
  14.  
  15. if (LEFT(ADDRESS(), 6) ~= "POLYED") then do
  16.     if SHOW("Ports", "POLYED.1") then
  17.         address 'POLYED.1'
  18.     else do
  19.         say "PolyEd is not running!"
  20.         exit
  21.     end
  22. end
  23.  
  24. 'LOCKGUI'
  25.  
  26. /*----- begin of custom code area --------------------------------------*/
  27.                                                      
  28. 'GETATTR APPLICATION FLAG_AUTOINDENT'             /* orig. state of auto-indent */
  29. state = RESULT
  30. 'SETATTR APPLICATION FIELD FLAG_AUTOINDENT NEWVALUE 1' /* enable auto-indent */
  31. 'POSITION EOL'                                   /* move cursor to end of line */
  32. 'TEXT NEWLINE'                    /* create a new line (indents automatically) */
  33. 'SETATTR APPLICATION FIELD FLAG_AUTOINDENT NEWVALUE' state /* reset to orig. state */
  34.  
  35. /*----- end of custom code area ----------------------------------------*/
  36.  
  37. 'UNLOCKGUI'
  38. EXIT
  39.  
  40. SYNTAX:                                     /* ARexx error...           */
  41.  
  42. say "Error line" SIGL ":" ERRORTEXT(RC)     /* report it...             */
  43. 'UNLOCKGUI'                                 /* Unlock GUI!              */
  44. EXIT                                        /* exit                     */
  45.  
  46. FAILURE:
  47. 'UNLOCKGUI'                                 /* Unlock GUI!              */
  48. EXIT                                        /* exit                     */
  49.